package com.ftl.framework.Activities;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.ftl.framework.Dialog;
import com.ftl.framework.DialogButton;
import com.ftl.framework.R;
import com.ftl.framework.R.id;
import com.ftl.framework.R.layout;

public class FrameworkActivity extends Activity {
    /** Called when the activity is first created. */

	
	private Button btnDialogs;
	private Button btnImages;
	
	
	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        btnDialogs = (Button)findViewById(R.id.btnDialogs);
        btnImages = (Button)findViewById(R.id.btnImages);
        
        
        btnDialogs.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {

				Intent i = new Intent(FrameworkActivity.this,DialogsActivity.class);
				startActivity(i);
			
			}
		});

        btnImages.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent i = new Intent(FrameworkActivity.this,ImagesActivity.class);
				startActivity(i);
			}
		});

        
     
        /*
        AsyncRunner mAsync = new AsyncRunner();
        
        
        String url = "http://staging.webar.net:8070/pruebas/android.php";
        Bundle parametros = new Bundle();
        
        parametros.putString("nombre", "Lucas");
        
        mAsync.request(url, parametros, new CustomRequestListener() {
			
			@Override
			public void onMalformedURLException(MalformedURLException e, Object state) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onIOException(IOException e, Object state) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onFileNotFoundException(FileNotFoundException e, Object state) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onCustomError(CustomError e, Object state) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onComplete(String response, Object state){
				// TODO Auto-generated method stub
				
				try{
					final JSONObject json = Util.parseJson(response);
					
					FrameworkActivity.this.runOnUiThread(new Runnable() {
	                    public void run() {
	    					if (json != null)
	    					{
	    						DialogButton btnCerrar = new DialogButton("Cerrar", new ButtonOnClickListener(BTN_CERRAR));
	    						
	    						Dialog.alert(FrameworkActivity.this, "Hola", "Como estas?");
	    					}
	    					else
	    						Dialog.alert(FrameworkActivity.this, "Chau", "chauuuuuuuu");
	                    }
	                });					
					
				}catch(JSONException e){}
				 catch(CustomError e){}
				
			}
		});
        */
        
        
    }

   
}